# 单词首字母大写
name = "ada lovelace"
print(name.title())

# 大小写变换
print(name.upper())
print(name.lower())

# 输出变量 字符串拼接
first_name = "ada"
last_name = "lovelace"
full_name = f"{first_name} {last_name}"
print(full_name)
print(f"Hello,{full_name.title()}!")
message = f"Hello,{full_name.title()}!"
print(message)

# 添加空白 制表符等
print("python")
print("\tPython")
print("Languages:\nPython\nC\nJavaScript")
print("Languages:\n\tPython\n\tC\n\tJavaScript")

# 删除左右空白
favorite_language = "python "
print(favorite_language)
print(favorite_language.rstrip()) #删除右空白
print(favorite_language)
favorite_language = favorite_language.rstrip()
print(favorite_language)

favorite_language = " Python "
print(favorite_language)
print(favorite_language.rstrip())
print(favorite_language.lstrip())

# 删除前缀
nostarch_url = "https://nostarch.com"
print(nostarch_url)
print(nostarch_url.removeprefix("https://"))

# 其他内容
"""可以切片
可以使用.splite转换为列表"""
test = "hello world"
print(test[:2])
print(test.split())
test1 = test[1:]
print(test1)

